package cn.edu.zut.internship.service.impl.sys;

import cn.edu.zut.internship.iservice.sys.UserSV;
import cn.edu.zut.internship.utils.RedisUtils;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;
import java.util.concurrent.TimeUnit;

@Service
public class UserSVImpl implements UserSV {
    @Autowired
    private RedisUtils redisUtils;
    public String getUserName(String id) {
        //查询缓存中是否存在
        boolean hasKey = redisUtils.hasKey(id);
        String str = "";
        if(hasKey){
            str =  (String)redisUtils.get(id);
        }
        else{
            str = "0000000";
            redisUtils.set(id,str,1000000L);
        }
        return str;
    }

    @Override
    public Map getUserInfo(String UserId) {
        return null;
    }

    @Override
    public Map getMenu(String UserId) {
        return null;
    }
}
